#include <stdio.h>
#include <string.h>
#define flag '#'

void progressBar2(double current,double total)
{
    char s[] = "/-|\\";
    char buff[101];
    memset(buff,0,101);
    int count = (int)((current/total)*100);
    for(int i = 0;i<count;++i)
    {
        buff[i] = flag;
    }
    static int k = 0;
    k%=4;
    printf("[%-100s][%d%%][%c]\r",buff,count,s[k++]);
    fflush(stdout);
}
